#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QtXml>
#include <QtXml/QDomDocument>
#include <QPainter>
#include <QtCore>
#include <QtGui>
#include "ui_mainwindow.h"

#include "curvabezier.h"
#include "curvahermit.h"

#define MAX_SIZE 512

class MainWindow : public QMainWindow, public Ui_MainWindow
{
    Q_OBJECT
private:

	bool creating_curve;

	QTransform _worldTransformation;

	Curva* _currentCurve;

	QGraphicsScene _scene;
	QVector<Curva*> _curves;
	QPointF* pointFound;

	double pointSize;

	void drawAxis();


private slots:
	void adjustSlider(int d);

public:
    explicit MainWindow(QWidget *parent = 0);

signals:
	void enableStepsSlider(bool);
	void setStepsSlider (int);

public slots:
	void reset();
	void load();
	void plotCurves();
	void adjustTransform();
	void changeColor();
	void loadCurveOptions();
	void save();
	void mouseDragDoubleClick (QPointF p);
	void mouseDragMove (QPointF p);
	void mouseDragRelease (void);

	void deleteCurrentCurve();
	void saveCurrentCurveAsImage();

	void createPoint (QPointF p);
	void createBezierCurve (void);
	void createHermitCurve (void);

	void deletePoint (void);

	void stepsSliderChanged (int steps);
};

#endif // MAINWINDOW_H
